// import com.alibaba.druid.sql.ast.SQLExpr;
// import com.alibaba.druid.sql.ast.SQLName;
// import com.alibaba.druid.sql.ast.expr.SQLIntegerExpr;
// import com.alibaba.druid.sql.ast.statement.SQLExprTableSource;
// import com.alibaba.druid.sql.dialect.mysql.visitor.MySqlASTVisitor;

// import java.util.ArrayList;
// import java.util.List;

#include "MySqlFlushStatement.h"
#include "../../../../ast/SQLExpr.h"
#include "../../../../ast/SQLName.h"
#include "../../../../ast/expr/SQLIntegerExpr.h"
#include "../../../../ast/statement/SQLExprTableSource.h"
#include "../../visitor/MySqlASTVisitor.h"
#include "../../../../../utils/listTran.h"

MySqlFlushStatement::MySqlFlushStatement()
{
  tables = std::make_shared<std::list<SQLExprTableSource_ptr>>();
}
BOOL_ptr MySqlFlushStatement::isNoWriteToBinlog()
{
  return noWriteToBinlog;
}

void MySqlFlushStatement::setNoWriteToBinlog(BOOL_ptr noWriteToBinlog)
{
  this->noWriteToBinlog = noWriteToBinlog;
}

BOOL_ptr MySqlFlushStatement::isLocal()
{
  return local;
}

void MySqlFlushStatement::setLocal(BOOL_ptr local)
{
  this->local = local;
}

SQLExprTableSource_list_ptr MySqlFlushStatement::getTables()
{
  return tables;
}

BOOL_ptr MySqlFlushStatement::isWithReadLock()
{
  return withReadLock;
}

void MySqlFlushStatement::setWithReadLock(BOOL_ptr withReadLock)
{
  this->withReadLock = withReadLock;
}

BOOL_ptr MySqlFlushStatement::isForExport()
{
  return forExport;
}

void MySqlFlushStatement::setForExport(BOOL_ptr forExport)
{
  this->forExport = forExport;
}

BOOL_ptr MySqlFlushStatement::isBinaryLogs()
{
  return binaryLogs;
}

void MySqlFlushStatement::setBinaryLogs(BOOL_ptr binaryLogs)
{
  this->binaryLogs = binaryLogs;
}

BOOL_ptr MySqlFlushStatement::isDesKeyFile()
{
  return desKeyFile;
}

void MySqlFlushStatement::setDesKeyFile(BOOL_ptr desKeyFile)
{
  this->desKeyFile = desKeyFile;
}

BOOL_ptr MySqlFlushStatement::isEngineLogs()
{
  return engineLogs;
}

void MySqlFlushStatement::setEngineLogs(BOOL_ptr engineLogs)
{
  this->engineLogs = engineLogs;
}

BOOL_ptr MySqlFlushStatement::isGeneralLogs()
{
  return generalLogs;
}

void MySqlFlushStatement::setGeneralLogs(BOOL_ptr generalLogs)
{
  this->generalLogs = generalLogs;
}

BOOL_ptr MySqlFlushStatement::isHots()
{
  return hots;
}

void MySqlFlushStatement::setHots(BOOL_ptr hots)
{
  this->hots = hots;
}

BOOL_ptr MySqlFlushStatement::isLogs()
{
  return logs;
}

void MySqlFlushStatement::setLogs(BOOL_ptr logs)
{
  this->logs = logs;
}

BOOL_ptr MySqlFlushStatement::isPrivileges()
{
  return privileges;
}

void MySqlFlushStatement::setPrivileges(BOOL_ptr privileges)
{
  this->privileges = privileges;
}

BOOL_ptr MySqlFlushStatement::isOptimizerCosts()
{
  return optimizerCosts;
}

void MySqlFlushStatement::setOptimizerCosts(BOOL_ptr optimizerCosts)
{
  this->optimizerCosts = optimizerCosts;
}

BOOL_ptr MySqlFlushStatement::isQueryCache()
{
  return queryCache;
}

void MySqlFlushStatement::setQueryCache(BOOL_ptr queryCache)
{
  this->queryCache = queryCache;
}

BOOL_ptr MySqlFlushStatement::isRelayLogs()
{
  return relayLogs;
}

void MySqlFlushStatement::setRelayLogs(BOOL_ptr relayLogs)
{
  this->relayLogs = relayLogs;
}

SQLExpr_ptr MySqlFlushStatement::getRelayLogsForChannel()
{
  return relayLogsForChannel;
}

void MySqlFlushStatement::setRelayLogsForChannel(SQLExpr_ptr relayLogsForChannel)
{
  this->relayLogsForChannel = relayLogsForChannel;
}

BOOL_ptr MySqlFlushStatement::isSlowLogs()
{
  return slowLogs;
}

void MySqlFlushStatement::setSlowLogs(BOOL_ptr showLogs)
{
  this->slowLogs = showLogs;
}

BOOL_ptr MySqlFlushStatement::isStatus()
{
  return status;
}

void MySqlFlushStatement::setStatus(BOOL_ptr status)
{
  this->status = status;
}

BOOL_ptr MySqlFlushStatement::isUserResources()
{
  return userResources;
}

void MySqlFlushStatement::setUserResources(BOOL_ptr userResources)
{
  this->userResources = userResources;
}

BOOL_ptr MySqlFlushStatement::isErrorLogs()
{
  return errorLogs;
}

void MySqlFlushStatement::setErrorLogs(BOOL_ptr errorLogs)
{
  this->errorLogs = errorLogs;
}

BOOL_ptr MySqlFlushStatement::isTableOption()
{
  return tableOption;
}

void MySqlFlushStatement::setTableOption(BOOL_ptr tableOption)
{
  this->tableOption = tableOption;
}

void MySqlFlushStatement::accept0(MySqlASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(MySqlFlushStatement)))
  {
    SQLObject_list_ptr tmp = ListTran::tran_class<SQLExprTableSource, SQLObject>(tables);
    acceptChild(visitor, tmp);
    acceptChild(visitor, relayLogsForChannel);
  }
  visitor->endVisit(SharedObject(MySqlFlushStatement));
}

void MySqlFlushStatement::addTable(SQLName_ptr name)
{
  if (name == nullptr)
  {
    return;
  }
  this->addTable(SQLExprTableSource_ptr(new SQLExprTableSource(name)));
}

void MySqlFlushStatement::addTable(SQLExprTableSource_ptr table)
{
  if (table == nullptr)
  {
    return;
  }
  table->setParent(SharedObject(MySqlFlushStatement));
  this->tables->push_back(table);
}

SQLIntegerExpr_ptr MySqlFlushStatement::getVersion()
{
  return version;
}

void MySqlFlushStatement::setVersion(SQLIntegerExpr_ptr version)
{
  this->version = version;
}

BOOL_ptr MySqlFlushStatement::isMaster()
{
  return master;
}

void MySqlFlushStatement::setMaster(BOOL_ptr master)
{
  this->master = master;
}
